<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of exist_objsubfield</title>
  <meta name="keywords" content="exist_objsubfield">
  <meta name="description" content="Checks whether the subfield exists">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html . -->
<h1>exist_objsubfield
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Checks whether the subfield exists</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [isthere] = exist_objsubfield(subj,objtype,objname,fieldname,subfieldname) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Checks whether the subfield exists

 [ISTHERE] = EXIST_SUBFIELD(SUBJ,OBJTYPE,OBJNAME,FIELDNAME,SUBFIELDNAME)

 Checks whether the SUBFIELDNAME exists inside the FIELD of the
 object OBJNAME of OBJTYPE.

 Returns true if it does, else false.</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="get_object.html" class="code" title="function [obj] = get_object(subj,objtype,objname)">get_object</a>	Return the entire object.</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [isthere] = exist_objsubfield(subj,objtype,objname,fieldname,subfieldname)</a>
0002 
0003 <span class="comment">% Checks whether the subfield exists</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% [ISTHERE] = EXIST_SUBFIELD(SUBJ,OBJTYPE,OBJNAME,FIELDNAME,SUBFIELDNAME)</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% Checks whether the SUBFIELDNAME exists inside the FIELD of the</span>
0008 <span class="comment">% object OBJNAME of OBJTYPE.</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% Returns true if it does, else false.</span>
0011 
0012 <span class="comment">% This is part of the Princeton MVPA toolbox, released under the</span>
0013 <span class="comment">% GPL. See http://www.csbmb.princeton.edu/mvpa for more</span>
0014 <span class="comment">% information.</span>
0015 
0016 
0017 obj = <a href="get_object.html" class="code" title="function [obj] = get_object(subj,objtype,objname)">get_object</a>(subj,objtype,objname);
0018 
0019 <span class="keyword">if</span> ~isfield(objname,fieldname)
0020   isthere = false;
0021   warning(<span class="string">'The field itself doesn''t exist, let alone the subfield'</span>);
0022   <span class="keyword">return</span>
0023 <span class="keyword">end</span>
0024 
0025 <span class="keyword">if</span> isfield(objname.(fieldname),subfieldname)
0026   isthere = true;
0027 <span class="keyword">else</span>
0028   isthere = false;
0029 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Tue 06-Sep-2005 22:11:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>